import request from '@/utils/request'

export function getPages(params) {
  return request({
    url: '/quyu/getList',
    method: 'get',
    params
  })
}

export function getquyuListNoPage(params) {
  return request({
    url: '/quyu/getListNoPage',
    method: 'get',
    params
  })
}

export function quyuAdd(data) {
  return request({
    method: 'post',
    url: '/quyu/add',
    data: {
      ...data
    }
  })
}

export function quyuUpdate(data) {
  return request({
    method: 'post',
    url: '/quyu/edit',
    data: {
      ...data
    }
  })
}

export function quyuDel(id) {
  return request({
    method: 'get',
    url: '/quyu/deleteById',
    params: {
      id
    }
  })
}

export function quyuUpdateDisabled(ids, enable) {
  let _ids = []
  if (Array.isArray(ids)) _ids = ids
  else _ids = [ids]
  return request({
    method: 'get',
    url: '/quyu/changeStatus',
    params: {
      ids: _ids.join(','),
      enable
    }
  })
}
